package com.starsoft.smdc.job;

import java.util.Date;

import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.starsoft.frame.base.bean.BaseJobLog;
import com.starsoft.frame.base.job.AbstractJob;
import com.starsoft.frame.util.SpringContext;
import com.starsoft.smdc.crawler.SmdcUpdateService;
import com.starsoft.smdc.service.HolidayService;

public class MarketDailyUpdateJob extends AbstractJob {

	private Logger logger = LoggerFactory.getLogger(MarketDailyUpdateJob.class);

	@Override
	public void run(JobExecutionContext context, BaseJobLog jobLog) {
		HolidayService holidayService = SpringContext.getBean(HolidayService.class);
		SmdcUpdateService updateSevice = SpringContext.getBean(SmdcUpdateService.class);
		boolean isBusy = holidayService.isBusinessDay(new Date());
		if (!isBusy) {
			logger.info("not business date");
			return;
		}
		updateSevice.updateMarketAll(null);
	}

}
